package cn.xopencode.securityservice.dal.mysql.mapper.activity;

import cn.xopencode.common.framework.vo.SortingField;
import cn.xopencode.mybatis.core.query.QueryWrapperX;
import cn.xopencode.mybatis.core.util.PageUtil;
import cn.xopencode.securityservice.dal.mysql.dataobject.activity.ActivityDO;
import cn.xopencode.securityservice.rpc.activity.dto.ActivityPageReqDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

@Repository
public interface ActivityMapper extends BaseMapper<ActivityDO> {
    default IPage<ActivityDO> selectPage(ActivityPageReqDTO pageReqDTO) {
        return selectPage(PageUtil.build(pageReqDTO,  pageReqDTO.getSorts()),
                new QueryWrapperX<ActivityDO>().eqIfPresent("activity_time", pageReqDTO.getActivityTime()));
    }
}


